import { defineConfig } from "vite"
import vue from "@vitejs/plugin-vue"
import { vitePluginForArco } from "@arco-plugins/vite-vue"
import path from "path"
import { createSvgIconsPlugin } from "vite-plugin-svg-icons"

// https://vitejs.dev/config/
export default defineConfig({
  base: "./",

  plugins: [
    vue(),

    // arco.design按需导入
    vitePluginForArco({
      style: "css",
    }),

    // Svg图标注册插件
    createSvgIconsPlugin({
      // 图标的文件夹路径
      iconDirs: [path.resolve(process.cwd(), "src/assets/icons")],
      // 图标的id结构
      symbolId: "icon-[dir]-[name]",
    }),
  ],
  resolve: {
    alias: {
      "@": path.resolve("./src"),
    },
  },
})
